home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
pas_all.zip
/
TI188.ASC
< prev
next >
Wrap
Text File
|
1992-08-12
|
3KB
|
133 lines
PRODUCT : TURBO PASCAL NUMBER : 188
VERSION : 3.02A
OS : PC-DOS, MS-DOS
DATE : October 9, 1986 PAGE : 1/2
TITLE : ADVANCED FILE HANDLINGT
The following information is presented for advanced users of
Turbo Pascal using MS-DOS or PC-DOS operating systems.
Turbo Pascal uses MS-DOS file handles to open files. Function
call 3DH is used. One of the parameters to this call is the "open
mode," which provides DOS with information about the way you
intend to access the file and what access to allow other process
Turbo Pascal normally uses an open mode byte of 2, which
designates Compatibility Mode with Read/Write Access and
Inheritance by child processes. By changing the value of this
byte to 0, you may open Read-only files. There may be other
applications for
Open mode byte for Reset & Rewrite (PC-DOS):
TURBO.COM CSEG:$24C6
TURBO-87.COM CSEG:$1F75
TURBOBCD.COM CSEG:$23CE
Open mode byte for Reset & Rewrite (MS-DOS):
TURBO.COM CSEG:$21EE
TURBO-87.COM CSEG:$1C9D
TURBOBCD.COM CSEG:$20F6
The best way to use this information is to create an absolute
variable pointing to the byte, for example:
var OpenModeByte: byte absolute CSeg:$24C6; (TURBO.COM PC-DOS)
For additional safety, make sure that the value of the byte being
changed is actually 2 before changing it. Remember, change it
back to 2 if you intend to do normal file opening intermixed with
opening of Read-only or shared files. Information on the diff
{ Using TURBO.COM version 3.02 }
var OpenModeByte: byte absolute CSeg:$24C6; (TURBO.COM PC-DOS)
Procedure AccessReadOnly;
begin
PRODUCT : TURBO PASCAL NUMBER : 188
VERSION : 3.02A
OS : PC-DOS, MS-DOS
DATE : October 9, 1986 PAGE : 2/2
TITLE : ADVANCED FILE HANDLING
if not(OpenModeByte in [0, 2]) then
Error
else
OpenModeByte := 0;
end;
procedure AccessReadWrite;
begin
if not(OpenModeByte in [0, 2]) then
Error
else
OpenModeByte := 2;
end;
The open mode byte for overlay, chain, and execute files is
normally 0, Compatibility Mode with Read Access. The addresses
for these mode bytes can be found by searching the run-time
library for the bytes 00 3D. The first occurrence is the one used
for ov
DISCLAIMER: You have the right to use this technical information
subject to the terms of the No-Nonsense License Statement that
you received with the Borland product to which this information
pertains.